<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">


<title>文档管理--文档回收站</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="css/luyan/luyan.css" type="text/css"></link>
<link rel="stylesheet" href="easyui/themes/icon.css" type="text/css"></link>
	 <link rel="stylesheet" href="easyui/themes/default/easyui.css" type="text/css"></link>
	 <script type="text/javascript" src="easyui/jquery-1.8.3.js"></script>
	 <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
	$(function(){
	  		$("#dg").datagrid({
	  			url:"recycle/findAll.do",
	  			striped:true,	  			
	  			rownumbers:true,
	  			title:"文档回收站列表",
	  			pagination:true,
	  			pageList:[10,20,50],
	  			columns:[[{
	  				title:"名称",
	  				field:"name",
	  				width:100,
	  				align:"right",
	  			},{
	  				title:"类型",
	  				field:"type",
	  				width:150,
	  				align:"center",
	  				formatter:function(){
	  					return "文件";
	  				}
	  			},{
	  				title:"所有者",
	  				field:"userid",
	  				width:100,
	  				align:"right"
	  			},{
	  				title:"操作",
	  				field:"id",
	  				width:100,
	  				align:"right",
	  				formatter:function (value,row,index){
						return "<a onclick='update("+row.id+")' href='javascript:void(0)'>还原</a>&nbsp;&nbsp;&nbsp;<a onclick='del("+row.id+")' href='javascript:void(0)'>删除</a>";
						}	  				
	  			}]]  	
	  		});
	  	
	  });
		function update(value){
			$.messager.confirm("提示框", "你确定要还原吗?",function(r){
				if(r){
					var data = "id="+value;
					$.post(
		  				"recycle/updateStatus.do",
		  				data,
		  				function(data){
		  				alert(data);
		  				$("#dg").datagrid("reload");
		  				
		  				},
		  				"text"
		  			);
				}
			});
		};
		function del(value){
			$.messager.confirm("提示框", "你确定要删除吗?",function(r){
				if(r){
					var data = "id="+value;
					$.post(
		  				"recycle/delete.do",
		  				data,
		  				function(data){
		  				alert(data);
		  				$("#dg").datagrid("reload");
		  				
		  				},
		  				"text"
		  			);
				}
			});
		};

</script>

</head>

<body style="height: 800px" id="mainbody">
	<p style="margin-bottom: 20px"><img src="css/luyan/img/icons/contacts.png" width="32px" height="32px"/>&nbsp;&nbsp;<span>文档管理</span></p> 
	<table id="dg"></table>  
	<div class="content">
	</div>


</body>
</html>
